import Vue from 'vue'
import Router from 'vue-router'
import { getNavData } from '@/nav/index'
Vue.use(Router);
let defaultView = [
  {
    path:'/',
    name:'home',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../components/login/index.vue'),
  },
  {
    path: '/forget',
    name: 'forget',
    component: () => import('../components/forget/index.vue'),
  },
  {
    path:'/admin-customer-detail',
    name:'会员详情',
    component: () => import('../components/memberDetail/index.vue'),
  },
  {
    path:'/admin-package-add',
    name:'添加套餐',
    component: () => import('../components/setMeal/addSetMeal/index.vue'),
  },
  {
    path:'/admin-card-add',
    name:'添加卡项',
    component: () => import('../components/card/addCard/index.vue'),
  },
  {
    path:'/admin-order-info',
    name:'订单详情',
    component: () => import('../components/order/detail/index.vue'),
  },
];
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
};
export default new Router({
  routes: defaultView.concat(getNavData)
})
